package cn.qiyu5522.tk_ems.component;

import org.springframework.stereotype.Component;
import org.springframework.util.DigestUtils;

/**
 * @BelongsProject: tk_ems
 * @BelongsPackage: cn.qiyu5522.tk_ems.component
 * @Author: TangQi
 * @CreateTime: 2023-01-30  11:15
 * @Description: TODO
 * @Version: 1.0
 */
@Component
public class Md5TokenGenerator {
    public String generate(String... strings) {
        long timestamp = System.currentTimeMillis();
        String tokenMeta = "";
        for (String s : strings) {
            tokenMeta = tokenMeta + s;
        }
        tokenMeta = tokenMeta + timestamp;
        String token = DigestUtils.md5DigestAsHex(tokenMeta.getBytes());
        return token;
    }

}
